package com.nlgc365.designpattern.Chapter04_Pattern.P02_Factory;

import org.junit.Test;

import java.util.Scanner;

public class T01_Scanner {
    @Test
    public void test_nextLine() {
        Scanner scanner = new Scanner(System.in);
        System.out.print("next:");
        String str_next = scanner.next();
        System.out.println("nextLine:");
        String str_nextLine = scanner.nextLine();
        System.out.println("str_next: " + str_next);
        System.out.println("str_nextLine: " + str_nextLine);
    }

    @Test
    public void test_nextLine2() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("InputSome: ");
        String nextLine = scanner.nextLine();
        System.out.println(nextLine);
    }

    @Test
    public void test_next() {
        Scanner scanner = new Scanner(System.in);
        System.out.println("nextLine: ");
        String s = scanner.nextLine();
        System.out.println("nextLine: " + s);
        System.out.println("InputInt: ");
        int nextInt = scanner.nextInt();
        System.out.println("InputSome: ");
        String next = scanner.next();
        System.out.println(next);
    }
}
